package xinxin.com.FactoryMethodPatternLeifeng;

import xinxin.com.FactoryMethodPatternLeifeng.Factory.UndergraduteFactory;
import xinxin.com.FactoryMethodPatternLeifeng.IFactory.IFactory;
import xinxin.com.FactoryMethodPatternLeifeng.LeiFeng.LeiFeng;
import xinxin.com.FactoryMethodPatternLeifeng.SimpleFactory.SimpleFactory;

public class FactoryMethodPattern {
    public static void main(String[] args) {
//        LeiFeng student1 = SimpleFactory.CreateLeiFeng("学雷锋的大学生");
//        student1.Sweep();
//        LeiFeng student2 = SimpleFactory.CreateLeiFeng("学雷锋的大学生");
//        student2.Wash();
//        LeiFeng student3 = SimpleFactory.CreateLeiFeng("学雷锋的大学生");
//        student3.BuyRice();
        IFactory factory = new UndergraduteFactory();
        LeiFeng studennt = factory.CreateLeiFeng();
        studennt.BuyRice();
        studennt.Sweep();
        studennt.Wash();
    }
}
